﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy3_1_3_
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnCalculate_Click(object sender, EventArgs e)
        {
            double x = double.Parse(txtX.Text);
            double y = double.Parse(txtY.Text);
            double r = double.Parse(txtR.Text);

            // 创建Circle类对象
            Circle circle = new Circle();
            // 给对象的成员赋值
            circle.SetValue(x, y, r);

            // 获取并显示圆的面积、周长、圆心到原点的距离
            lblArea.Text =  circle.GetPerimeter().ToString();
            lblPerimeter.Text =  circle.GetArea().ToString();
            lblDistance.Text =  circle.GetDistance().ToString();
        }
    }
    
}
